ORuseLog $nLogObjectId
$strPathName - Pathname of a file to which to direct all log output. This path may be relative or absolute. The file doesn't have to exist. If it does, its existing content will be overwritten.
$nLogObjectId - The log object identifier of an existing log object. Note that you can obtain the log object identifier of the current log object by using the getCurrentLogfileId command.
# Get the id of the current log.
set nInitialLogId [ getCurrentLogfileId ]
DPrint "This sentence is printed to our initial log object, but we're going to switch in a second."
# Switch to a new logfile.
useLog "MyNewLogfile.log"
DPrint "Unlike the first sentence, this one is __NOT__ printed to our initial log but goes to the new log we just opened."
# Switch back to our initial log file.
set strReturnValue [ useLog $nInitialLogId ]
if { strReturnValue == "" } {
# Yay! It worked!
DPrint "Successfully switched back to our initial log."
} else {
# Shucks! Something went wrong.
DPrint "Failed to switch back to our initial log. Maybe we specified the wrong id or something ...?"
}